package pres.lnk.learn.designpattern.k_facade.facade;

import pres.lnk.learn.designpattern.k_facade.parts.CPU;
import pres.lnk.learn.designpattern.k_facade.parts.Disk;
import pres.lnk.learn.designpattern.k_facade.parts.Memory;

/**
 * 门面类，客户通过该类调用内部功能，简化客户与子系统直接访问的复杂度
 * @Author lnk
 * @Date 2018/2/27
 */
public class Compute {
    private CPU cpu;
    private Disk disk;
    private Memory memory;

    public Compute(){
        cpu = new CPU();
        disk = new Disk();
        memory = new Memory();
    }

    public void startup(){
        cpu.startup();
        disk.startup();
        memory.startup();
    }

    public void showdown(){
        cpu.showdown();
        disk.showdown();
        memory.showdown();
    }
}
